<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>LS10</title>
</head>
<body>
    <input type="text" id="inputID">
    <input type="button" onclick="Foo()" name="Test" value="测试">
    </br>
    <label>输出结果：</label>
    <label id = "labelID">_______</label>
</body>
<script>
    var reg = /[a-z[0-9]]/gi;
    function foo(){
            (function(doc){
        var inputID = doc.getElementById('inputID');
        var str = inputID.innerHTML;
        var labelID = doc.getElementById('labelID');
        if(reg.test(str)){
            labelID.innerHTML = 'true';
        }
        else{
            labelID.innerHTML = 'false';
        }
    })(document)
    }

</script>
</html>